Skip to content

Conversation

GittyBurstein
Copy link
Contributor

Summary

Implements the ARANGE operator for the SYCL backend, generating evenly-spaced sequences on SYCL devices (Intel GPUs). Enables fast tensor initialization. The changes are small and focused.

Changes

  • Added ARANGE kernel in element_wise.cpp
  • ARANGE support in ggml-sycl.cpp
  • Integrated into the SYCL compute pipeline

Implementation

  • 1D tensor: start, step, number of elements = tensor size
  • Parallel processing (256 threads) following existing SYCL patterns

Testing

  • All existing tests pass
  • ARANGE tests: sizes 1K–10M, step 0.01–100.0, output verified

Performance

  • Small data: CPU faster
  • Large data (>1M): GPU 2–3 × faster
  • Peak GPU throughput: ~3 GElements/sec (Intel Iris Xe)

Compatibility

  • F32, OpenCL, and Level Zero

@github-actions github-actions bot added ggml changes relating to the ggml tensor library for machine learning SYCL https://en.wikipedia.org/wiki/SYCL - GPU programming language labels Sep 30, 2025
@GittyBurstein
Copy link
Contributor Author

This PR adds the ARANGE operator to the SYCL backend (small & focused changes),
bringing significant performance improvements on large tensors.

@ggerganov @ggerganov/ggml-maintainers –
Please review when convenient. This PR is ready for review & merge.

@GittyBurstein
Copy link
Contributor Author

Hi @Rbiessy and @NeoZhangJianyu,

Following up on this PR after 3 weeks - adds ARANGE operator support for SYCL backend with significant performance improvements.

The changes are minimal and fully tested. Would appreciate a review when possible.

Thanks!

@Rbiessy
Copy link
Collaborator

Rbiessy commented Oct 15, 2025

Hello @GittyBurstein, sorry I am not maintaining the SYCL backend anymore. I'm not sure who else can help you merge this PR.

Copy link
Collaborator

@NeoZhangJianyu NeoZhangJianyu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's good work!
I test by UT. It's passed!

Thank you!

@NeoZhangJianyu
Copy link
Collaborator

@GittyBurstein
Please correct the code format issues found by CI.

Thank you!

@GittyBurstein
Copy link
Contributor Author

Hi @NeoZhangJianyu,

Thank you very much for reviewing the code!
I've applied the requested formatting fixes to the ARANGE operator, and the code is now ready for review and merge.

Thanks again!

@GittyBurstein
Copy link
Contributor Author

Hi @NeoZhangJianyu,

I forgot to mention earlier that two CI tests failed, but after reviewing the failures, I realized they were not related to my changes. Everything that was related to my code has been properly fixed.

Thank you very much, and I would be happy to see this merged. 😉

@GittyBurstein
Copy link
Contributor Author

Hi @CISC 👋

My PR for adding the ARANGE operator to the SYCL backend was already reviewed and approved by the SYCL maintainer, who confirmed that the implementation is correct and only required minor formatting fixes (extra spaces, etc.) for the CI checks.

I’ve applied all the requested formatting corrections, but since this PR is from a fork, the CI workflows are currently awaiting approval.

If everything looks good on your side, I’d really appreciate it if you could approve/run the workflows and merge the PR when convenient.
Thank you very much for your time and help! 🙏

@CISC CISC merged commit b22572e into ggml-org:master Oct 16, 2025
161 of 169 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ggml changes relating to the ggml tensor library for machine learning SYCL https://en.wikipedia.org/wiki/SYCL - GPU programming language

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants